package org.test;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 测试tomcat是否可以拦截请求
 */
public class DemoHttpServlet extends HttpServlet {

    public DemoHttpServlet() {
        System.out.println("-------- 进入DemoHttpServlet 了构造函数");

    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("22、请求 >>>>>>>>>>>>>>>> get 请求进入");
        super.doGet(req, resp);

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("22、请求 >>>>>>>>>>>>>>>> post 请求进入");

        super.doPost(req, resp);

    }
}
